import { CHANGE_INPUTVALUE,ADD_TO_DATA,DEL_TO_DATA } from './actionType';

// 定义action 对象

// 输入框变化action
export const CHANGE_INPUTVALUE_ACTION = (value) => {
    return {
        type: CHANGE_INPUTVALUE,
        value
    }
}


// 添加事项action
export const ADD_TO_DATA_ACTION = () => {
    return {
        type: ADD_TO_DATA
    }
}

// 此方法使用redux-thunk
export const ADD_TO_DATA_ACTION_THUNK = () => {
    return (dispatch) => {
        setTimeout(() => {
            dispatch({ type: ADD_TO_DATA });
        }, 2000);
    }
}


// 删除事项action
export const DEL_TO_DATA_ACTION = (value) => {
    return {
        type: DEL_TO_DATA,
        value
    }
}


